<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>分页显示</title>
</head>

<body>
	<%
set conn=server.createobject("adodb.connection")
conn.open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&server.mappath("Databases/0479netdate.mdb"))
set rs=server.createobject("adodb.recordset")
sql="SELECT * FROM UserOrder WHERE UserID = 33 Order BY OrderDate DESC"
rs.open sql,conn,1
rs.pagesize=6
if request("page")<>"" then
  epage=cint(request("page"))
   if epage<1 then epage=1
   if epage>rs.pagecount then epage=rs.pagecount
else
epage=1
end if
rs.absolutepage=epage
%>
<table border="0" cellpadding="0" cellspacing="1" bgcolor="#0000FF" width="80%" align="center">
<tr bgcolor="#FFFFFF" align="center">
<th><%=rs(0).name%></th><th><%=rs(1).name%></th><th><%=rs(2).name%></th>
</tr>
<%
for i=0 to rs.pagesize-1
if rs.bof or rs.eof then exit for
%>
<tr bgcolor="#FFFFFF" align="center">
<td><%=rs(0).value%></td><td><%=rs(1).value%></td><td><%=rs(2).value%></td>
</tr>
<%
rs.movenext()
next
%>
</table>
<p align="center">
<a href="?page=1">首页</a>&nbsp;
<a href="?page=<%=epage-1%>">前一页</a>&nbsp;
<a href="?page=<%=epage+1%>">后一页</a>&nbsp;
<a href="?page=<%=rs.pagecount%>">末页</a>
</p>
<p align="center">现在是第<%=epage%>页一共有<%=rs.pagecount%>页</p>
<%
conn.close()
%>
	
</body>
</html>
